﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Wap/Shop/ShopSite.Master" AutoEventWireup="true" CodeBehind="NavCategory2.aspx.cs" Inherits="ZLCMS.Web.Wap.Shop.NavCategory2" %>
<%@ Register src="NavCategory.ascx" tagname="NavCategory" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="pages" runat="server">
<div data-role="page" id="currentorders" data-theme="b">
  <header data-role="header" data-position="fixed" class="nav-hed">
     <uc1:NavCategory ID="NavCategory_1" runat="server" />
    </header>
    <div data-role="content">
        <a href=""><img src="images/title1.png" style="width:100%;display:block;"></a>
        <ul class="smlist">
        </ul>
        <div style="display:none">
            <button id="btnMore" data-icon="refresh" style="width: 95%; margin-left: auto; margin-right: auto;">显示更多</button>
        </div>
    </div>
</div>

<script src="/wap/lib/common/listviewHandler.js" type="text/javascript"></script>
<script type="text/javascript" src="/wap/lib/iscroll-5/iscroll.js"></script>
<script>
    $(function () {
        $(".container a").click(function () {
            $(this).removeClass('').addClass('active').siblings().removeClass('active');
        });
        //$('.smlist').executeCommand({ successCallBack: function (result) {
           // var navHtml = '<li onclick="location.href=\'{Url}\'">' + '<img src="{FilePath}">' + '<div class="smright"><h4>{Title}</h4><span>{}</span><span class="old">平时价：￥198</span><p>年货价：<strong>￥78</strong></p><a href="{Url}" class="smbtn">我要购买</a>' + '</div>' + '</li>';
           // var temp = ""
           // $(result.List).each(function () {
               // this.FilePath = firstFilePath(this.ImageUrl);
               // temp += navHtml.format(this)
           // });
            //$('.smlist').html(temp);
       // }
       // }, 'Pub.LoadShopNavCategory', { Root: "3", Kind: "NAV" });

        function queryData() {
            var handler = $('.smlist').listviewHandler();

            var itemTemp = '<li onclick="location.href=\'{Url}\'">' + '<img src="{FilePath}">' + '<div class="smright"><h5>{Title}</h5><span class="describe">{Description}</span><span class="old">平时价：￥198</span><p>年货价：<strong>￥{Param2}</strong></p><a href="{Url}" class="smbtn">我要购买</a>' + '</div>' + '</li>';

            handler.initialize({
                loaderBtn: $('#btnMore'), //加载数据按钮（点击加载下一页）
                emptyHtml: '无记录', //无记录时显示此html
                itemTemplate: itemTemp, //项模板
                pageIndex: 1, //页码（从1起算）
                pageSize: 5, //页大小
                totalCount: 999, //总记录数
                itemHandler: function (data, itemTemplate, container) {//数据各项处理
                    data.FilePath = firstFilePath(data.PhotoUrl);
                    return itemTemplate.format(data);
                },
                command: 'Pub.LoadAdProduct',
                parameter: { PositionCode: 'HOME_XV_HOT' }
            });
            handler.nextPage();
        }
        queryData();

        $(function () {
            $(window).scroll(function () {
                //当内容滚动到底部时加载新的内容

                if ($(this).scrollTop() + $(window).height() + 10 >= $(document).height() && $(this).scrollTop() > 10) {
                    //当前要加载的页码
                    $('#btnMore').click();
                }
            });
        });
    });
</script>
</asp:Content>